﻿namespace Jiubang.Collections {
	using System.Collections.Generic;
	using System.Web.Caching;

	/// <summary>
	/// 缓存项过期时的回调
	/// </summary>
	/// <typeparam name="K"></typeparam>
	/// <typeparam name="V"></typeparam>
	/// <param name="key"></param>
	/// <param name="value"></param>
	/// <param name="reason"></param>
	public delegate void CacheItemRemovedCallback<K, V> (K key, V value, CacheItemRemovedReason reason);

	/// <summary>
	/// 缓存未命中时的回调
	/// </summary>
	/// <param name="key">未命中的键</param>
	public delegate V CacheItemMissedCallback<K, V> (K key);

	/// <summary>
	/// 缓存项批量回收时的回调
	/// </summary>
	/// <param name="removedItems">被回收的项</param>
	public delegate void CacheItemsRecycledCallback<K, V> (IList<KeyValuePair<K, V>> removedItems);
}